package my.maven.project.common.redis;
 

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

 
public class RedisUtils {
 
//# Redis数据库索引（默认为0）
	private static final String redis_database = "0";
//# Redis服务器地址
	private static final String host = "127.0.0.1";
//# Redis服务器连接端口
	private static final int port = 6379;
//# Redis服务器连接密码（默认为空）
	private static final String redis_password = "";
	
//	@Autowired
//	private JedisConfig jedisConfig;
	
  public static JedisPool redisPoolFactory(){
        JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
//        jedisPoolConfig.setMaxIdle(maxIdle);
//        jedisPoolConfig.setMaxWaitMillis(maxWaitMillis);
//        jedisPoolConfig.setMaxTotal(maxActive);
//        jedisPoolConfig.setMinIdle(minIdle);
        JedisPool jedisPool = new JedisPool(jedisPoolConfig,host,port,0,null);
        return  jedisPool;
    }
	

	public static Jedis getJedis() {
		return redisPoolFactory().getResource();
	}
	
}
